<template>
<h3>用户理财项目列表页面</h3>

项目名称
<input type="text" v-model="sinfo.UFName" />
理财总金额
<input type="text" v-model="sinfo.MinPrice" />-
<input type="text" v-model="sinfo.MaxPrice" />

<input type="button" value="查询" @click="Show" />

<table border="1">
    <thead>
        <tr>
            <td>用户理财编号</td>
            <td>用户项目名称</td>
            <td>用户项目总金额</td>
            <td>操作</td>
        </tr>
    </thead>

    <tbody>
        <tr v-for="item in info">
            <td>{{item.UFId}}</td>
            <td>{{item.UFName}}</td>
            <td>{{item.SumPrice}}</td>
            <td><a href="#" @click="Redmmon">赎回</a></td>
        </tr>
    </tbody>
</table>
</template>


<script setup lang="ts">
import {ref,onMounted} from 'vue'
import axios from 'axios'

const sinfo=ref({
    UFName:'',
    MinPrice:"",
    MaxPrice:""
})

const info=ref({
    UFId:0,
    UFName:'',
    SumPrice:0
})


onMounted(()=>{
    Show()
})


function Show(){
    axios.get('http://localhost:2742/api/Finan/Show',{
        params:{
            UFName:sinfo.value.UFName,
            MinPrice:sinfo.value.MinPrice,
            MaxPrice:sinfo.value.MaxPrice
        }
    }).then((res)=>{
        info.value=res.data
        console.log(info.value)
    })
}

const Redmmon=()=>{
   location.href="/UserRedeem"
}
</script>